package se.wangs.decorator.abstracttype.decorators;

import se.wangs.decorator.abstracttype.Beverage;
import se.wangs.decorator.abstracttype.CondimentDecorator;

/**
 * -- coding: UTF-8 -- *
 *
 * @author wangs
 * @date 2023/12/11 15:33
 * @description 加牛奶
 */
public class Whip extends CondimentDecorator {

    protected Beverage beverage;

    public Whip(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public double cost() {
        return 0.10 + beverage.cost();
    }

    @Override
    public String getName() {
        return beverage.getName() + ", Whip";
    }
}
